

<%@ page import="com.surelution.projects.crm.OwnStation" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'ownStation.label', default: 'OwnStation')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${ownStationInstance}">
            <div class="errors">
                <g:renderErrors bean="${ownStationInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:uploadForm method="post" action="update">
                <g:hiddenField name="id" value="${ownStationInstance?.id}" />
                <g:hiddenField name="version" value="${ownStationInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name"><g:message code="ownStation.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'name', 'errors')}">
                                    ${ownStationInstance?.name}
                                </td>
                            </tr> 
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="shortName"><g:message code="ownStation.shortName.label" default="shortName" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'shortName', 'errors')}">
                                    <g:textField name="shortName" value="${ownStationInstance?.shortName}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name"><g:message code="ownStation.manager.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'manager', 'errors')}">
                                    <g:textField name="manager" value="${ownStationInstance?.manager}" />
                                </td>
                            </tr> 

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" style="width:250px;" value="${ownStationInstance?.address}" />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="StationManageType"><g:message code="ownStation.level.label" default="level" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'manageType', 'errors')}">
                                    <g:select name="manageType.id" from="${com.surelution.projects.crm.StationManageType.list()}" optionKey="id" optionValue="manageType" value="${ownStationInstance?.manageType?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="Level"><g:message code="ownStation.level.label" default="level" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'company', 'errors')}">
                                    <g:select name="level.id" from="${com.surelution.projects.crm.Level.list()}" optionKey="id" optionValue="title" value="${ownStationInstance?.level?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="StarLevel"><g:message code="ownStation.star.label" default="star" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'star', 'errors')}">
                                    <g:select name="star.id" from="${com.surelution.projects.crm.StarLevel.list()}" optionKey="id" optionValue="title" value="${ownStationInstance?.star?.id}"  />
                                </td>
                            </tr>      
                                 
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="TonLevel"><g:message code="ownStation.tonLevel.label" default="tonLevel" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'tonLevel', 'errors')}">
                                    <g:select name="tonLevel.id" from="${com.surelution.projects.crm.TonLevel.list()}" optionKey="id" optionValue="title" value="${ownStationInstance?.tonLevel?.id}"  />
                                </td>
                            </tr>  
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="stationArea"><g:message code="ownStation.stationArea.label" default="stationArea" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'stationArea', 'errors')}">
                                    <g:select name="stationArea.id" from="${com.surelution.projects.crm.StationArea.list()}" optionKey="id" optionValue="areaName" value="${ownStationInstance?.stationArea?.id}"  />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.generalArea.label" default="generalArea" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'generalArea', 'errors')}">
                                    <g:textField name="generalArea" value="${ownStationInstance?.generalArea}" />
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.buildingArea.label" default="buildingArea" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'buildingArea', 'errors')}">
                                    <g:textField name="buildingArea" value="${ownStationInstance?.buildingArea}" />
                                </td>
                            </tr>  

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.coverArea.label" default="coverArea" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'coverArea', 'errors')}">
                                    <g:textField name="coverArea" value="${ownStationInstance?.coverArea}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.hallArea.label" default="hallArea" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'hallArea', 'errors')}">
                                    <g:textField name="hallArea" value="${ownStationInstance?.hallArea}" />
                                </td>
                            </tr>
                                                          
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="ownStation.hasShop.label" default="hasShop" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ownStationInstance, field: 'hasShop', 'errors')}">
                                    <%--<g:textField name="hasShop" value="${ownStationInstance?.hasShop}" /> 
                                    --%><select name="hasShop" style="margin-right:100px;" value="${ownStationInstance?.hasShop}" >
    										<option value="true">是</option>
    										<option value="false">否</option>
							    	</select>
							    	
                                </td>
                            </tr>                           
                                                                 
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <sec:ifAnyGranted roles="ROLE_ADMIN">
                    	<span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                	</sec:ifAnyGranted>
                </div>
            </g:uploadForm>
        </div>
    </body>
</html>
